package com.jiamao.goplay.data.source.http.service;

import com.jiamao.goplay.bean.BaseRep;
import com.jiamao.goplay.bean.FindItem;
import com.jiamao.goplay.bean.PlaceWantGoItem;
import com.jiamao.goplay.bean.res.ResAddrDetail;
import com.jiamao.goplay.bean.res.ResCheckPhoto;
import com.jiamao.goplay.bean.res.ResFind;
import com.jiamao.goplay.bean.res.ResImage;
import com.jiamao.goplay.bean.res.ResInviteMeList;
import com.jiamao.goplay.bean.res.ResLogin;
import com.jiamao.goplay.bean.res.ResMatch;
import com.jiamao.goplay.bean.res.ResMessage;
import com.jiamao.goplay.bean.res.ResNearbyList;
import com.jiamao.goplay.bean.res.ResPaifList;
import com.jiamao.goplay.bean.res.ResPlaceWanGo;
import com.jiamao.goplay.bean.res.ResSearchAddr;
import com.jiamao.goplay.bean.res.ResUserInfoDetail;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * Created by goldze on 2017/6/15.
 */

public interface ApiService {
    //手机号登陆
    @FormUrlEncoded
    @POST("account/phone-login")
    Observable<BaseRep<ResLogin>> loginPhone(@Field("Phone") String Phone,@Field("Code") String Code);

    //微信登陆
    @FormUrlEncoded
    @POST("account/wechat-login")
    Observable<BaseRep<ResLogin>> loginWeChat(@Field("UniqueId") String UniqueId, @Field("AppOpenid") String AppOpenid,@Field("WxSign") String WxSign);

    //发送短信
    @FormUrlEncoded
    @POST("sms/send")
    Observable<BaseRep> sendSMS(@Field("Phone") String Phone, @Field("CodeType") int Type);


    //注册用户资料
    @FormUrlEncoded
    @POST("account/profile")
    Observable<BaseRep> regiestUserInfo(@Field("Nickname") String Nickname, @Field("Birthday") String Brithday, @Field("Gender") String Gender, @Field("Avatar") String Avatar);


    //上传图片接口
    @Multipart
    @POST("upload/image")
    Observable<BaseRep<ResImage>> uploadImage(@Part MultipartBody.Part file,@Part("Type") RequestBody param);



    //我的主页接口
    @POST("my/info")
    Observable<BaseRep<ResUserInfoDetail>> getMyUserInfo();

    @Headers("Content-Type: application/json")
    @POST("my/update")
    Observable<BaseRep<ResUserInfoDetail>> editUserInfo(@Body RequestBody body);

    //他人主页接口
    @POST("user/info")
    @FormUrlEncoded
    Observable<BaseRep<ResUserInfoDetail>> getOtherUserInfo(@Field("Uid") String Uid);

    //附近
    @POST("search")
    @FormUrlEncoded
    Observable<BaseRep<ResNearbyList>>  nearbyList(@Field("Latitude") double Latitude,@Field("Longitude") double Longitude,@Field("Limit") int Limit, @Field("Page") int page);
    //附近
    @POST("/search/listcity")
    @FormUrlEncoded
    Observable<BaseRep<ResNearbyList>>  nearbyCityList(@Field("City") String City,@Field("Limit") int Limit, @Field("Page") int page);


    //地点搜索
    @POST("search/searchaddress")
    @FormUrlEncoded
    Observable<BaseRep<ResSearchAddr>> searchAddr(@Field("Keyword") String Keyword, @Field("Limit") int Limit, @Field("Page") int page,@Field("city") String city);

    //地点详情
    @POST("search/addrInfo")
    @FormUrlEncoded
    Observable<BaseRep<ResAddrDetail>>  addrDetail(@Field("PlaceId") String Id, @Field("Gender") int Gender, @Field("Limit") int Limit, @Field("Page") int page);

    //地点详情 我的进入
    @POST("search/myaddrInfo")
    @FormUrlEncoded
    Observable<BaseRep<ResAddrDetail>>  myUseraAddrDetail(@Field("PlaceId") String Id, @Field("Gender") int Gender, @Field("Limit") int Limit, @Field("Page") int page);


    //发现列表
    @POST("search/find")
    @FormUrlEncoded
    Observable<BaseRep<ResFind>>  findList(@Field("Latitude") double Latitude, @Field("Longitude") double Longitude, @Field("Limit") int Limit, @Field("Page") int page, @Field("Gender") int Gender);


    // 添加到我想去
    @FormUrlEncoded
    @POST("user/addwhere")
    Observable<BaseRep>  detailAddCloection(@Field("PlaceId") String Id);

    //  取消我想去

    @POST("user/deletegowhere")
    @FormUrlEncoded
    Observable<BaseRep>  detailRemoveCloection(@Field("PlaceId") String Id);


    //我想去的
    @POST("user/mygoList")
    @FormUrlEncoded
    Observable<BaseRep<ResPlaceWanGo>> getMeGoToWhereList(@Field("Limit") int Limit, @Field("Page") int page);

    //他想去的
    @POST("user/hegoList")
    @FormUrlEncoded
    Observable<BaseRep<ResPlaceWanGo>>  getOtherGoToWhereList(@Field("uid") String uid,@Field("Limit") int Limit, @Field("Page") int page);

    //我的配对
    @POST("message/pairList")
    @FormUrlEncoded
    Observable<BaseRep<ResPaifList>>  getPairList(@Field("page") int page);

    //邀请我列表
    @POST("message/inviteMeList")
    @FormUrlEncoded
    Observable<BaseRep<ResInviteMeList>>  getInviteMeList(@Field("page") int page);


    //邀请他去
    @POST("user/invitingHe")
    @FormUrlEncoded
    Observable<BaseRep>  invitingHe(@Field("PlaceId") String PlaceId,@Field("InvitedUid") String InvitedUid);

    //接受邀请  完成配对
    @POST("message/acceptInvite")
    @FormUrlEncoded
    Observable<BaseRep<ResMatch>>  acceptInvite(@Field("id") String id);

    //取消邀请  完成配对
    @POST("message/delInvite")
    @FormUrlEncoded
    Observable<BaseRep>  delInvite(@Field("id") String id);

    //接触关系
    @POST("message/relieveRelation")
    @FormUrlEncoded
    Observable<BaseRep>  relieveRelation(@Field("uid") String uid);

    //接触关系
    @POST("message")
    Observable<BaseRep<ResMessage>>  messageList();



    //接触关系
    @Headers("Content-Type: application/json")
    @POST("my/addlocations")
    Observable<BaseRep>  addlocations(@Body RequestBody body);

    //接触关系
    @POST("feedback")
    @FormUrlEncoded
    Observable<BaseRep>  repot(@Field("Type") String Type,@Field("TargetUid") String TargetUid,@Field("EvidencePics") String EvidencePics,@Field("Content") String Content);


    //接触关系

    @POST("/check/avatarAuditStatus")
    Observable<BaseRep<ResCheckPhoto>>  checkavatarAuditStatus();

    //接触关系
    @POST("my/addlookeduser")
    @FormUrlEncoded
    Observable<BaseRep>  addlookeduser(@Field("DelUid ") String DelUid );


}
